package com.mask.im.business.controller.manage;

import com.mask.im.business.model.entity.SysLoginLogEntity;
import com.mask.im.business.model.vo.ConditionVO;
import com.mask.im.business.common.model.PageResult;
import com.mask.im.business.common.model.RestResponse;
import com.mask.im.business.service.SysLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 登录日志
 *
 * @author jian
 */
@Api("登录日志管理")
@RestController
public class SysLoginLogController {

    @Resource
    private SysLoginLogService loginLogService;


    @ApiOperation("获取登入日志")
    @GetMapping("/admin/loginRecordList")
    public PageResult<SysLoginLogEntity> loginRecordList(ConditionVO conditionVO) {
        return loginLogService.loginRecordList(conditionVO);
    }

    @ApiOperation("删除登入记录")
    @DeleteMapping("/admin/loginRecord/")
    public RestResponse<String> deleteLoginRecord(@RequestBody List<Integer> loginRecordIds) {
        return loginLogService.deleteLoginRecord(loginRecordIds);
    }
}

